﻿@model IMS_Partner
@{
    Layout = "_LayoutMobile";
    ViewBag.Title = "查看客户";
}
@section header {
    <style>
        .van-uploader__upload{
        display:none;
        }
    </style>
}
<van-nav-bar title="客户"
             :fixed="true"
             left-arrow
             @@click-left="goBack"
             @@click-right="goHome">
    <van-icon name="edit" slot="right" size="24" />
</van-nav-bar>
<van-cell-group>
    <van-cell title="单位名称" :value="model.Name||''"></van-cell>
    <van-cell title="拼音助记码" :value="model.PYCode||''"></van-cell>
    <van-cell title="单位编码" :value="model.Code||''"></van-cell>
    <van-cell title="电话" :value="model.Phone||''"></van-cell>
    <van-cell title="传真" :value="model.Fax||''"></van-cell>
    <van-cell title="联系人" :value="model.ContactMan||''"></van-cell>
    <van-cell title="联系电话" :value="model.ContactPhone||''"></van-cell>
    <van-cell title="详细地址" :value="model.Location||''"></van-cell>
    <van-cell title="备注" :value="model.Comment||''"></van-cell>
</van-cell-group>
@section footer {
    <script type="text/javascript">
        var modelJson=@(Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(Model, new Newtonsoft.Json.JsonSerializerSettings()
                {
                    DateFormatString = "yyyy-MM-dd HH:mm:ss"
                })))
        var modelData = $.extend(modelJson, {});
        var pageApp = new Vue({
             el: '#app',
                data: {
                    active:'my',
                    model:modelData,
                },
                methods: {
                    goBack(){
                        window.location.href = '@(Url.Action("MobileList", "Partner"))';
                    },
                    goHome(){
                        window.location.href = '@(Url.Action("MobileEdit", "Partner"))/' + modelData.ID + '?nc=' + new Date().getTime();
                    },
                },
                filters: {
                    formatDate: function (val) {
                        return utils.formatDate(val, 'yyyy-MM-dd');
                    },
                },
        });
        $(function () {
            if(!isMobile())
            {
                    window.location.href = '@(Url.Action("ViewDetail", "Partner"))/' + modelData.ID + '?nc=' + new Date().getTime();
            }
        });

        function isMobile() {
          const regExp = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
          return regExp.test(navigator.userAgent);
        }
    </script>
}